<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="google-site-verification" content="yaeorbXgKPwp5BDegBtAJEHYWFEFE-BViWTj74gJPrw" />
<!--  -->
<link href="/css/default.css" type="text/css" rel="stylesheet" />
<!--  -->
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/lang/cn.js"></script>
<script type="text/javascript" src="/js/mac/core.min.js"></script>
<title>JQuery MagicGrid 固定列的表格示例</title>
<meta name="description" content="JQuery MagicGrid 固定列的表格示例" />
<meta name="keywords" content="JQuery Grid Plugin" />
<script type="text/javascript" src="/js/mac/webapp.min.js"></script>
<script type="text/javascript" src="/js/jquery/mousewheel.js"></script>
<script type="text/javascript" src="/js/mac/pager.min.js"></script>
<link type="text/css" rel="stylesheet" href="/css/default/mac/grid/grid.min.css" />
<script type="text/javascript" src="/js/mac/grid.min.js"></script>
<style type="text/css">
.money { text-align: right; }
.demoPanel .viewPort { height: 420px; width: 480px; }
</style>
<script type="text/javascript">
$(function(){
	$('#nav_jump').change(function(){
		location = './' + this.value + '.html';
	}).val('fixCol');
	$('.demoSource').val($('#demo').html());
});
</script>
</head>
<body>
<div id="head">
	<a href="/"><img src="/css/images/logo_s.png" alt="logo" /></a>
	<div class="title">BOARSOFT.COM</div>
	<div class="right">
		<div>
			<a href="/public/lang.php?l=en">English</a>
			|
			<a href="/public/lang.php?l=cn">简体中文</a>
			|
			<a href="http://activemq.apache.org/" target="_blank">ActiveMQ</a>
			|
			<a href="https://redis.io/" target="_blank">Redis</a>
			|
			<a href="http://www.jquery.com/" target="_blank">JQuery</a>
		</div>
	</div>
</div><div id="nav">
	<div id="nav_path">
		&nbsp;&nbsp;
		<a href="/">Home</a>
		&gt;
		<a href="/mac/js/grid">JQuery MagicGrid</a>
		&gt;
		JQuery MagicGrid 固定列的表格示例	</div>
	<div id="nav_back">
		<a href="/mac/js/grid/doc" target="_blank">文档</a>
		|
		<a href="javascript:history.back()">后退</a>
		|
		<a href="/mac/js/grid/dl/fixCol.html">下载</a>
		|
		<select id="nav_jump">
			<option value="basic">JQuery MagicGrid 基本功能示例</option>
			<option value="exp">JQuery MagicGrid 可展开式表格示例</option>
			<option value="multiHeaders">JQuery MagicGrid 多行表头示例</option>
			<option value="fixCol">JQuery MagicGrid 固定列的表格示例</option>
			<option value="voucher">JQuery MagicGrid 凭证类型表格示例</option>
			<option value="edit">JQuery MagicGrid Inline 编辑示例</option>
			<option value="keyEvt">JQuery MagicGrid 按键事件插件示例</option>
		</select>
		&nbsp;&nbsp;
	</div>
	<div class="clear"></div>
</div>
<div class="demoInfo">
	<h2 class="demoTitle">JQuery MagicGrid 固定列的表格示例</h2>
</div>
<div id="demo" class="demoPanel"><!-- <script type="text/javascript" src="/js/mac/grid_fixCol.min.js"></script> -->
<script type="text/javascript" src="/src/js/mac/grid_fixCol.js"></script>
<style type="text/css">
/* For FixCol Plugin, You can merge this to default.css */
.grid>.fixed { float: left; display: none; }
.grid>.fixed>.body { overflow: hidden; border-left: 1px solid #93C3CD; }
.grid>.fixed>.body>.tt>.tr { white-space: nowrap; display: inline-block; }
.grid>.fixed>.head { border-right: none; }
.grid .tr.hover .td { background-color: #FBCC88; }
/* For mutli-headers */
.fixColGrid .head { height: 50px; }
.fixColGrid .ybar { margin-top: 48px; }
.fixColGrid .th { height: 48px; }
.fixColGrid .th .sizer { height: 48px; }
.fixColGrid .th[group] { height: 24px; border-left: 0px; }
.fixColGrid .foot .td { background-color: #CCC; height: 32px; }
</style>
<script type="text/javascript">
$(function(){
	var pg = $('body');
	var vw = pg.find('.view');
	var hd1 = $('<div class="tth"></div>');
	var hdt = $('<div style="height: 25px"><div class="title">'
		+ '&nbsp;Account</div></div>').appendTo(hd1);
	var hdb = $('<div style="height: 25px"></div>').appendTo(hd1);
	vw.mac('grid', {
		sortLocally: true,
		headerHeight: 48,
		cols : [{
			field: 'subject', width: 120, title : 'Subject',
			sizeable: true, moveable: false,
		},{
			field: 'account', title : 'account', header: hd1,
			width: 242, isGroup: true, sizeable: true
		},{
			field: 'debit', title : 'Debit', width: 120,
			sort: true, parent: hdb, group: 'account',
			render: function(r, tr){
				if(r.debit)
					return '<div class="money">$'+r.debit + '</div>';
				return '';
			}
		},{
			field: 'credit', title : 'Credit', width: 120,
			sort: true, parent: hdb, group: 'account',
			render: function(r, tr){
				if(r.credit)
					return '<div class="money">$'+r.credit + '</div>';
				return '';
			}
		},{
			field: 'summary', title : 'Summary', width: 400
		}],
		loader: {
			url: '/mac/js/grid/data.php',
			params: { pageNo: 1, pageSize: 50 },
			autoLoad: true
		},
		afterLoad: function(dd, po, me){
			//alert('This is orginal afterLoad function.');
		}
	});
	vw.mac('grid_fixCol');
	pg.seek('fix').click(function(){
		var fns = [ 'subject', 'account' ];
		if($(this).prop('checked')){
			vw.lockCols(fns);
		}else{
			vw.unlockCols();
		}
	});
});
</script>
<p><input type="checkbox" name="fix" />Fix Subject Column</p>
<div class="viewPort demoPanel" style="height: 360px;">
	<div class="view grid fixColGrid"></div>
</div></div>
<textarea class="demoSource" wrap="off"></textarea>
<iframe src="/mac/js/related.php" class="related"></iframe>
<div id="foot">
Copyright © 2011. All rights reserved&nbsp;&nbsp;蜀ICP备11014774号-1&nbsp;&nbsp;
QQ: 7213571&nbsp;&nbsp;E-mail: pyh_jerry@163.com&nbsp;&nbsp;
<!-- 
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Ffc0b0282216be3d16055855d8c0e72d9' type='text/javascript'%3E%3C/script%3E"));
</script>
&nbsp;&nbsp;
 -->
</div></body>
</html>
